package TCP.Test2;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Recvcie {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(10086);

        Socket socket = serverSocket.accept();

        InputStreamReader inputStreamReader = new InputStreamReader(socket.getInputStream());

        int b;
        while ((b=inputStreamReader.read())!=-1){
            System.out.println((char) b);
        }

        OutputStream outputStream = socket.getOutputStream();

        outputStream.write("瞅你咋地".getBytes());
        socket.close();
    }
}
